package com.cdream.basic.algorithm.leetcode.removeDuplicate;

/**
 * @author cdream
 * @date 5/9/21
 */
public class Question27 {
    public int removeElement(int[] nums, int val) {
        int k = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i]!=val){
                nums[k++] = nums[i];
            }
        }
        return k;
    }
}
